<?  layout("../layout/default.html") { ?>
<div class="admin-panel">
	<div class="tab">
		<div class="tab-head">
			<strong><? if(@data.isNew()){ ?>添加<? }else{ ?>编辑<?} ?></strong>
			<span class="tab-more"><a href="javascript:history.go(-1)" class="button  button-little bg-blue  icon-step-backward"> 返回</a></span>
			<ul class="tab-nav">
			  <li class="active"><a href="#tab-set">信息</a></li>
			</ul>
		</div>
		<div class="tab-body">
		<script type="text/javascript">
			function check(){
		    	var str0 = document.getElementById("sceneconfig_scene_id").value;
				var str1 = document.getElementById("sceneconfig_equipment_id").value;
				var str2 = document.getElementById("sceneconfig_status").value;
				var str3 = document.getElementById("sceneconfig_param1").value;
				var str4 = document.getElementById("sceneconfig_param2").value;
				var str5 = document.getElementById("sceneconfig_param3").value;
				var str6 = document.getElementById("sceneconfig_param4").value;
				var str7 = document.getElementById("sceneconfig_param5").value;
				if(str0.length>20){    
	     			alert("对不起，场景编号输入过长!");
	     		    document.getElementById("sceneconfig_scene_id").value="";
	     			return false; 
	     	    } 
				if(str1.length>20){    
	     			alert("对不起，设备编号输入过长!");
	     		    document.getElementById("sceneconfig_equipment_id").value="";
	     			return false; 
	     	    } 
				if(str1.length>20){    
	     			alert("对不起，状态输入过长!");
	     		    document.getElementById("sceneconfig_status").value="";
	     			return false; 
	     	    } 
				if(str2.length>20){    
	     			alert("对不起，设备参数1输入过长!");
	     		    document.getElementById("sceneconfig_param1").value="";
	     			return false; 
	     	    } 
				if(str3.length>20){    
	     			alert("对不起，设备参数2输入过长!");
	     		    document.getElementById("sceneconfig_param2").value="";
	     			return false; 
	     	    } 
				if(str4.length>20){    
	     			alert("对不起，设备参数3输入过长!");
	     		    document.getElementById("sceneconfig_param3").value="";
	     			return false; 
	     	    } 
				if(str5.length>20){    
	     			alert("对不起，设备参数4输入过长!");
	     		    document.getElementById("sceneconfig_param4").value="";
	     			return false; 
	     	    } 
				if(str6.length>20){    
	     			alert("对不起，设备参数5输入过长!");
	     		    document.getElementById("sceneconfig_param5").value="";
	     			return false; 
	     	    } 
			}
		</script>
			<div class="tab-panel active" id="tab-set">
				<form method="post" class="form-x" action="">
					<div class="form-group">
						<div class="label"><label for="sitename">场景编号</label></div>
						<div class="field">
						<input type="text" class="input" id="sceneconfig_scene_id" name="sceneconfig.scene_id" size="200" placeholder="请填写场景id" data-validate="required:请填写场景编号,number:请填写数字" value="${data.scene_id!""}"/>
						</div>
					</div>
					<div class="form-group">
						<div class="label"><label for="sitename">设备编号</label></div>
						<div class="field">
						<input type="text" class="input" id="sceneconfig_equipment_id" name="sceneconfig.equipment_id" size="200" placeholder="请填写设备编号" data-validate="required:请填写设备编号,number:请填写数字" value="${data.equipment_id!""}"/>
						</div>
					</div>
					<div class="form-group">
						<div class="label"><label for="sitename">状态</label></div>
						<div class="field">
						<input type="text" class="input" id="sceneconfig_status" name="sceneconfig.status" size="200" placeholder="请填写状态" data-validate="required:请填写状态" value="${data.status!""}"/>
						</div>
					</div>
					<div class="form-group">
						<div class="label"><label for="sitename">设备参数1</label></div>
						<div class="field">
						<input type="text" class="input" id="sceneconfig_param1" name="sceneconfig.param1" size="200" placeholder="请填写设备参数" data-validate="required:请填写设备参数" value="${data.param1!""}"/>
						</div>
					</div>
					<div class="form-group">
						<div class="label"><label for="sitename">设备参数2</label></div>
						<div class="field">
						<input type="text" class="input" id="sceneconfig_param2" name="sceneconfig.param2" size="200" placeholder="请填写设备参数" data-validate="required:请填写设备参数" value="${data.param2!""}"/>
						</div>
					</div>
					<div class="form-group">
						<div class="label"><label for="sitename">设备参数3</label></div>
						<div class="field">
						<input type="text" class="input" id="sceneconfig_param3" name="sceneconfig.param3" size="200" placeholder="请填写设备参数" data-validate="required:请填写设备参数" value="${data.param3!""}"/>
						</div>
					</div>
					<div class="form-group">
						<div class="label"><label for="sitename">设备参数4</label></div>
						<div class="field">
						<input type="text" class="input" id="sceneconfig_param4" name="sceneconfig.param4" size="200" placeholder="请填写设备参数" data-validate="required:请填写设备参数" value="${data.param4!""}"/>
						</div>
					</div>
					<div class="form-group">
						<div class="label"><label for="sitename">设备参数5</label></div>
						<div class="field">
						<input type="text" class="input" id="sceneconfig_param5" name="sceneconfig.param5" size="200" placeholder="请填写设备参数" data-validate="required:请填写设备参数" value="${data.param5!""}"/>
						</div>
					</div>
				<div class="form-button"><button class="button bg-main" type="submit" onclick="return check()">提交</button></div>
			    </form>
			</div>
		</div>
	</div>
</div>
<?  } ?>			